home *** CD-ROM | disk | FTP | other *** search
- CH 14 - CUSTOMISING POWERBASE
- =============================
- This chapter describes all the things you can do to influence the way
- Powerbase looks and functions.
-
- 14.1 Overall control of the database
- =====================================
- A Powerbase database is normally controlled in four ways:−
-
- • mouse-clicks on the keypad
- • keystrokes which mimic the actions of the keypad
- • choices from the main menu
- • choices from the icon-bar menu
-
- Each of these can be disabled by deselecting one of the option switches on
- the Password window (see 11.2). The main reason why you might want to do
- this is to provide limited facilities to someone else who is using your
- database. It doesn’t, on the face of it, make a lot of sense to disable
- both the keypad and the keystroke-equivalents as no browsing or editing
- would then be possible. You can, however, place some or all of the keypad
- buttons on the record screen itself (see 4.2.9) thus allowing you to choose
- what functions you want to allow access to. You might, for example, wish to
- provide only the “Next record”, “Previous record” and “Search” buttons.
- Define these as Button fields at the time the record is being designed then
- disable the keypad and keystroke equivalents.
-
- Other switches in the Password window enable you to stop the user exporting
- data as CSV files or subsets or printing reports.
-
- 14.2 Defining the function keys
- ================================
- Any button on the keypad may have its action duplicated by one of the keys
- F1-F11, with or without the use of Shift or Ctrl.
-
- Point at the button to which you wish to assign a key and click MENU to
- display the keypad menu. Assign leads to a window which shows the present
- key-assignment, if any. Use the “bump” icons to select the required function
- key and, if desired, select one of the switches for Shift and Ctrl. Click on
- the Assign button and you will now find that the assigned key exactly mimics
- the keypad button − even to the extent of actually “pressing” the button
- when you type the key.
-
- One important constraint should be noted. Whatever key you assign to the
- Search button, Powerbase will automatically assign the shifted version of
- this key to the “search all subfiles” function (see 2.3.1). For this reason
- you should assign an unshifted key to Search and avoid assigning the shifted
- version to any other keypad button. Similarly, assigning a key to the New
- record button automatically assigns the shifted key to the Copy record
- function.
-
- You may save your key definitions by choosing Save choices from the keypad
- menu and you will find them operative next time you use Powerbase. Please
- note that your definitions work with all the databases you use; there is no
- facility for saving separate assignments for each database. The default
- keystrokes (together with some which duplicate non-keypad actions) are
- listed in Appendix B. If they have been redefined you may restore the
- defaults by choosing Defaults from the keypad menu. If you wish to “lose”
- the redefined keystrokes permanently you should restore the defaults as
- described then Save choices.
-
- List keys on the keypad menu displays all the key definitions (including
- those for non-keypad functions) in a window from which the information may
- be saved as a text file.
-
- Function keys may also be used to enter data into record fields or writable
- icons in dialogue boxes. The actual programming of the keys is done at the
- command line which is accessed by pressing f12. This takes you temporarily
- out of the desktop and gives you a “star” prompt at the bootm of the screen.
- Suppose you want to program f3 to enter the word “Powerbase”. Type, at the
- star prompt:
- Key3 Powerbase
-
- and press Return twice to return to the desktop. The string assigned to the
- key may be entered by typing Ctrl-Shift-f3. Any of the keys f1-f9 may be
- programmed and the string is always entered by typing the key with Ctrl and
- Shift both held down.
-
- 14.3 Print options
- ===================
- The Print options window, accessible from the Print submenu or by typing
- Shift Print, was described in some detail in 3.5 but a few features still
- require comment. You may set up this window to suit the requirements for a
- particular database and then save the set-up as part of the database by
- clicking on Save choices with the in database radio button selected.
-
- A Save box appears which, by default, saves the options file in the PrintRes
- directory under the name PrtOptions. A file of that name, in that directory,
- is read when the database is subsequently re-opened and will set up the
- print options as you left them. You can, of course, give the file a
- different name and even save it in a different place if you wish. Print
- option files are recognisable by their icon, which bears a large “P”. Some
- users like to have several of them in their database’s PrintRes directory to
- do different jobs. It is always possible to load the one you want by opening
- the PrintRes directory (Show resources from Print submenu or, alternatively,
- Ctrl R) and double-clicking on the required file or dragging it onto the
- record window.
-
- Should you wish to “throw out” your special keys set-up during a working
- session with the database you can restore the default settings by clicking
- Load default. If you like your own setup better than the default and wish to
- use it for all your databases then select the as default radio button before
- clicking Save choices. The file PrtOptions will then be saved inside
- Powerbase itself. Note also that, provided the Print options window has not
- been closed, the Cancel button will restore it to the state it was in when
- you opened it.
-
- 14.4 CSV options
- =================
- It was explained in 8.2 how to access the CSV options window and what the
- pop-up menus and option switches are for. The buttons Save choices, as
- default, in database, Load default and Cancel work in a similar way to that
- described above for the Print options window − with one notable difference.
- No Save box appears when you Save choices in database; the file is saved as
- a plain text file called CSVoptions. This more limited behaviour has been
- chosen because, although you might want several Print options files for
- different jobs, it is unlikely that you will have a use for several CSV
- options files.
-
- 14.5 Preferences
- =================
- Several previous references have been made to the Preferences window which
- is opened from the icon-bar menu. A full description of the choices offered
- in this window follows.
-
- 14.5.1 Separators in date and time fields
- -----------------------------------------
- By default dates have the format dd-mm-yy or dd-mm-yyyy, i.e. the separator
- is a hyphen. You might wish to use a colon, full-stop, slash or other
- character. You may type any non-numeric character when entering dates and
- Powerbase will re-format the field to use the specified character. Only
- fields actually defined to be of type Date behave in this way.
-
- Fields defined to be of type Time have the form hh:mm:ss, i.e a colon is
- used as the separator. As in the case of dates, you may type any non-numeral
- you like during data entry and Powerbase will reformat the time as above.
-
- To change either of these separators type the required character into the
- writable icon in place of the default.
-
- 14.5.2 Wild-cards
- -----------------
- The use of wild-card characters is described in 2.7.5 and 3.3.4. By default
- “#” represents a single character and “$” a group of characters which need
- not be matched. You may change either or both wild-card characters if you
- wish in the same way as described above for date and time separators.
-
- 14.5.3 Option switches
- ----------------------
- Record edits as CSV file when ON causes a CSV file called NewData to be
- created in PrintJobs. New and edited records are saved in this file which
- may then be used to enter data into another Powerbase database.
-
- Launch new copy
- ···············
- When ON, causes another copy of Powerbase to be loaded when you double-click
- on a database, instead of closing the current database. This can be useful
- if you want to access several databases at once, as one copy Powerbase only
- supports the use of a single database. If there is a dormant copy of
- Powerbase on the icon-bar (i.e. one with “No data” under its icon) then
- double-clicking a database sends it to that copy rather than launching a new
- one. With the switch OFF double-clicking on a database closes down an
- already-open database before opening the new one. Even then you can load
- multiple copies of Powerbase by double-clicking on Powerbase itself and then
- open a different database in each by dragging the databases to the icons.
-
- Recalculate on opening
- ······················
- Affects Composite fields (see 6.2) whose associated formulae make use of the
- system variable TIME$. With the switch OFF the contents of such fields are
- recalculated only when a record is displayed. This might not be good enough
- where, for example, TIME$ is used in a User function (see 6.3) to keep track
- of people’s current ages. Selecting the switch causes Powerbase to scan the
- whole file and update such fields when the database is first opened.
-
- Blank record on deletion
- ························
- If this switch is OFF then deleting a record from the database merely
- removes all references to its key(s) from the index(es), leaving the actual
- record data untouched in the Database file. Although such “deleted” records
- will be overwritten when new records are entered, the situation may be
- deemed unsatisfactory from a security point of view since the “deleted”
- records can be examined by simply loading Database into Edit. If the switch
- is ON deletion causes the relevant record to be over-written with a blank
- record.
-
- Keep descriptor with data
- ·························
- Alters the behaviour of fields as they are dragged around the screen when
- designing the record layout. With the switch OFF you may drag the data
- field and the descriptor independently of one another. With the switch ON
- this is true only of the descriptor; if you drag the data field the
- descriptor jumps to its “normal” position to the left of the data field as
- soon as you release the mouse button.
-
- Validate input
- ··············
- Turns data validation (see Ch 5) ON and OFF. If you ever find yourself
- unable to escape from a field linked to a validation table you can bring up
- the Preferences window, deselect this switch and try again.
-
- Display linked table data
- ·························
- Every time the caret enters a field with a link to a validation table a
- window showing data from the relevant validation table row appears to the
- right of the field if the switch is ON. This is either useful or
- infuriating, depending on your point of view. If turned OFF you can still
- call up the window for a specific field by double-clicking on the field with
- SELECT (see 5.5).
-
- Warn of external deletion
- ·························
- Since deleting data from an External field (see 2.6) involves the deletion
- of an actual file you will probably appreciate being warned when you are
- about to do it. With this switch ON you will be given a warning and the
- opportunity to change your mind.
-
- Warn of duplicates
- ··················
- The creation of records with identical primary keys can be prohibited if so
- desired (see 11.2.1). Normally, however, they are permitted. You may, if you
- wish, turn this switch ON to issue a warning that such a record is about to
- be created.
-
- Default action on Return
- ························
- According to the Acorn Style Guide for RISC OS typing Return anywhere inside
- a dialogue box ought to have the same effect as clicking on the default
- action button (that’s the one with the yellow channel border) regardless of
- which writable icon the caret is in. If that’s what you want then turn this
- switch ON. Many users (including the author!) hate it and prefer the default
- action to take place only if the caret is in the last writable icon when
- Return is typed. Hence the default setting, which is OFF.
-
- Strip leading spaces
- ····················
- Is ON by default. Spaces at the beginning of data fields will be stripped
- before the record is written to the file. Turn the switch OFF if you
- actually want spaces in this position
-
- Strip trailing spaces
- ·····················
- Should normally be left ON to avoid unwanted spaces at the right of data
- fields. It is easy to press the space-bar by accident when entering data
- quickly and you might not notice that a field has one or more spaces between
- the end of the last word and the caret.
-
- Balance every <n> records
- ·························
- The need to balance indices and the use of this option is explained in 10.6.
-
- Remember place in subfile
- ·························
- With this switch OFF a change of subfile leads to the display of the first
- record in the new subfile. If you are doing a lot of hopping back and forth
- between subfiles to inspect specific records you might want to select the
- switch. It is then just as if you had bookmarks in separate chapters of a
- book; when you return to a subfile you have previously visited you will see
- the same record you were viewing when you left that subfile.
-
- 14.5.4 Save indices (Default: Manual)
- -------------------------------------
- Indices are always saved whenever you close a database or quit Powerbase and
- only fear of power cuts or system failure (which includes some kind person
- switching off your computer!) need make you concerned about saving them
- yourself. With the Manual setting nothing happens during normal working
- unless you click Force update on the keypad. Selecting Automatic or Warn
- only allows you to type in a suitable time interval (default = 10 min) at
- which Powerbase will either issue a warning to save your indices (using
- Force update) or actually save them for you.
-
- 14.5.5 Start editing at
- -----------------------
- When a record is displayed the caret is placed, by default, in the first
- editable field. Editing may be made to start at a different field by
- choosing Start editing from the Field submenu (see 2.5.4) or, alternatively,
- by placing the caret in the required field and typing Ctrl-S. The tag of
- the relevant field is stored in this writable icon in the Preferences window
- and can be saved along with the other preferences.
-
- 14.5.6 Application for ImpulseII data-merging
- ---------------------------------------------
- As noted elsewhere (9.2) Powerbase can merge directly into a
- suitably-formatted Impression document by simply dropping the document icon
- onto the record window. The dialogue box which then appears contains a
- writable icon which shows the application with which Powerbase will merge.
- This name is, by default, “Impression”, but may be altered by users for
- their own purposes. An application which will receive data from Powerbase in
- this way must make use of the ImpulseII protocols as defined by Computer
- Concepts. Even if you are using Style or Publisher the name to which these
- applications respond is still “Impression”.
-
- 14.5.7 Save choices
- -------------------
- This section of the window works exactly as it does for CSV options (see
- 14.4) as do the Load default and Cancel buttons.
-
- 14.6 Colours of key fields and linked fields
- =============================================
- These may be selected in a window reached by choosing Colours from the
- Miscellaneous submenu. The following default colours are used:−
-
- Type Foreground Background
-
- Descriptor of key field (inactive) dark blue light grey
- Descriptor of key field (active) red light grey
- Data icon of primary key field(s) black pale yellow
- Data icon of field linked to validation table dark green white
-
- Clicking with SELECT on the descriptor and data icons within this window
- makes either the foreground or background (depending on the setting of the
- two radio buttons) cycle through the available colours. Clicking with ADJUST
- cycles through the colours in the opposite direction.
-
- Apply allows you to see the effect of the changes and Defaults enables you
- to return the colours to what they were before, provided you haven’t clicked
- on Save choices. The latter applies the new colours and saves the changes so
- that they are effective next time the database is used. Different databases
- may have different colours.
-
- 14.7 The Config file
- =====================
- Inside the Powerbase application directory is a sub-directory called
- Resources. The file Config, which will be found there, determines certain
- aspects of the program’s operation which will seldom need changing. Changes
- made to Config take effect only when Powerbase is next loaded. If you load
- the file into Edit you will see lines which determine:−
-
- • maximum number of fields per record (default = 100, maximum = 127)
-
- • maximum number of subsidiary indices (default = 10)
-
- • maximum number of validation tables (default = 10)
-
- • maximum number of pop-up menu fields (default = 3)
-
- • maximum number of columns in a validation table (default = 20)
-
- • whether submenus off the icon-bar menu open on the left instead of
- on the right as normal. This avoids the overlapping submenus which
- can occur but many users hate it! Put YES, instead of NO, at the
- start of the line if you want the icon-bar menu to work like that.
-
- • background colour of record window. Default (1) is pale grey.
-
- • whether password entry is forced to uppercase. Earlier versions of
- Powerbase allowed only uppercase letters in passwords and some users
- may wish to place YES at the start of this line. Current versions
- of Powerbase allow both upper and lowercase letters.
-
- • display option for directories opened by buttons on the record
- window. Default is -si (small icons). This may be changed to -li or
- -fi (large icons and full information respectively). The options to
- sort by name, type, date and size (-sn, -st, -sd, -ss) may also be
- added after a space.
-
- • method used for storing Text, Sprite and Draw files which are linked
- to External fields. A description of the old and new methods is
- given below.
-
- When altering Config be sure to leave a space between the number or word
- which begins the line and the explanation.
-
- 14.7.1 Pathnames for External file objects
- ------------------------------------------
- The system used is detemined by pacing the word OLD or NEW at the beginning
- of the relevant line in Config.
-
- The OLD method of deriving the pathname for the stored file object is as
- follows:−
-
- (a) Divide the record number by 4900. The integer part of the result is
- used as the name of the top-level directory.
-
- (b) Divide the record number by 70. The integer part of the result is used
- as the name of the second-level directory.
-
- (c) The integer remainder of dividing the record number by 70 is used as the
- actual filename.
-
- This is an awkward system if you are in the habit of using the filer windows
- to sift through the files rather than relying on Powerbase to display them.
- To calculate the number of the record to which the file belongs you have to
- take the number forming the name of the file’s parent directory, multiply by
- 70 and add the number corresponding to the filename itself.
-
- The new system improves on this. Steps (a) and (b) are identical. The
- filename itself, however, uses the whole record number preceded by Rec, e.g.
- a file associated with record 275 will be called Rec275. You can therefore
- use the RISC OS filer’s Find command to locate and examine the file. Under
- the OLD system such a file would be called 65.
-
- The default setting in Config is NEW. Users should be aware that the
- earliest version of Powerbase to support this feature is v. 6.94, dated
- 02-03-96. This and later versions understand both methods of storage and
- will rename files according to the Config setting. Thus, a database created
- under an earlier version in which record 275 is represented by a file called
- 65 will have that file renamed to Rec275 simply by displaying the record,
- even if the file itself is not loaded. Once this has happened the file
- cannot be found by an earlier version of Powerbase. Under most
- circumstances this should not cause any difficulty; just make sure you are
- using v. 6.94 or later. Should you wish to run a database under an earlier
- version and access the External file objects from the record window you must
- first convert the filenames to the OLD format. To do so place OLD in the
- Config file as described above, then load Powerbase. Open your database and
- click on the Play button. Click on Stop when all records have been
- displayed. If you use more than one subfile you will need to do this for
- each occupied subfile. OLD may be converted to NEW pathnames in a similar
- way.
-
- 14.8 The Messages file
- =======================
- This text file in the Resources sub-directory contains all the error and
- warning messages used by Powerbase including those for Acorn’s interactive
- Help application. The wording may be altered if you wish. Many error
- messages contain the string “%0” and possibly “%1” and “%2”. Data items are
- substituted for these when the message is printed so don’t omit them or
- alter their logical placement within the message.